#include <math.h>
#include "Vector2.h"

float Vector2::lenth()
{
    return sqrt(x * x + y * y);
}

Vector2 Vector2::normalize()
{
	float len = lenth();
    if(len==0)
		return Vector2(0, 0);

    return Vector2(x/len,y/len);
}
